package com.function;

import java.util.function.Supplier;

/**
 * Supplier 供给型接口，只有一个返回值
 */
public class SupplierDemo {

    public static void main(String[] args) {

//        Supplier supplier = new Supplier<String>() {
//            @Override
//            public String get() {
//                return "供给型接口";
//            }
//        };

        Supplier supplier = () -> {
            return "供给型接口";
        };

        System.out.println(supplier.get());
    }
}
